#pragma once
#include"RedBlackTree.h"

template<class k,class v>
class map
{

	class mapKeyOfT
	{
	public:
		const k& operator()(const pair<k, v>& value)
		{
			return value.first;
		}
	};

public:
	typedef typename RedBlackTree<k, pair<k, v>, mapKeyOfT>::iterator iterator;

	bool insert(const pair<k, v>& value)
	{
		return _tree.insert(value);
	}

	iterator begin()
	{
		return _tree.begin();
	}

	iterator end()
	{
		return _tree.end();
	}

	iterator find(const k& value)
	{
		return _tree.find(value);
	}

private:
	RedBlackTree<k, pair<k, v>,mapKeyOfT> _tree;
};


